Global Index
HTML5 JS API Index > SVG Tutorials & Specs

SVGAngle

The SVGAngle interface corresponds to the <angle> basic data type.

Properties
const unsigned short
SVG_ANGLETYPE_DEG = 2
The unit type was explicitly set to degrees.
const unsigned short
SVG_ANGLETYPE_GRAD = 4
The unit type is radians.
const unsigned short
SVG_ANGLETYPE_RAD = 3
The unit type is radians.
const unsigned short
SVG_ANGLETYPE_UNKNOWN = 0
The unit type is not one of predefined unit types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
const unsigned short
SVG_ANGLETYPE_UNSPECIFIED = 1
No unit type was provided (i.e., a unitless value was specified). For angles, a unitless value is treated the same as if degrees were specified.
unsigned short
unitType
The type of the value as specified by one of the SVG_LENGTHTYPE_* constants defined on this interface.
float
value
The value of the given attribute. Exceptions on settingDOMException, code NO_MODIFICATION_ALLOWED_ERR Raised on an attempt to change the value of a read only attribute.
DOMString
valueAsString
The value as a string value, in the units expressed by unitType. Setting this attribute will cause value, valueInSpecifiedUnits and unitType to be updated automatically to reflect this setting. Exceptions on settingDOMException, code SYNTAX_ERR Raised if the assigned string cannot be parsed as a valid <length>.
float
valueInSpecifiedUnits
The value as a floating point value, in the units expressed by unitType. Setting this attribute will cause value and valueAsString to be updated automatically to reflect this setting. Exceptions on settingDOMException, code NO_MODIFICATION_ALLOWED_ERR Raised when the length corresponds to a read only attribute or when the object itself is read only.
Operations
void
convertToSpecifiedUnits(unsigned short unitType)
Preserve the same underlying stored value, but reset the stored unit identifier to the given unitType. Object attributes unitType, valueInSpecifiedUnits and valueAsString might be modified as a result of this method. Parametersunsigned short unitType The unit type to switch to (e.g., SVG_ANGLETYPE_DEG).
void
newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits)
Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object. Parametersunsigned short unitType The unit type for the value (e.g., SVG_ANGLETYPE_DEG). float valueInSpecifiedUnits The angle value.
Referenced by
SVGAnimatedAnglebaseVal
SVGMarkerElementsetOrientToAngle(...)
SVGSVGElementcreateSVGAngle()